package com.matrix.java.chap_03.example;

import java.util.Scanner;

/**
 * SubtractionQuiz
 * @since 2021-10-21-16:56
 */
public class Case3_03 {
    public static void main(String[] args) {
        int num1 = (int) (Math.random()*10);
        int num2 = (int) (Math.random()*10);
        if (num1 < num2) {
            int temp = num1;
            num1 = num2;
            num2 = num1;
        }
        int result = num1-num2;

        Scanner input = new Scanner(System.in);
        System.out.print(num1+" "+num2+"差为: ");
        int num3 = input.nextInt();

        if (num3 == result) {
            System.out.println("正确");
        } else {
            System.out.println("错误");
        }

    }
}
